<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MDF Lib: include/mdf/mdfhelper.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="utillib.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">MDF Lib<span id="projectnumber">&#160;2.2</span>
   </div>
   <div id="projectbrief">Interface against MDF 3/4 files</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_dea88a92c3ac1d8c329848683c200b71.html">mdf</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">mdfhelper.h</div></div>
</div><!--header-->
<div class="contents">
<a href="mdfhelper_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright 2022 Ingemar Hedvall</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> * SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> */</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemdf.html">mdf</a> {</div>
<div class="foldopen" id="foldopen00015" data-start="{" data-end="};">
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html">   15</a></span><span class="keyword">class </span><a class="code hl_class" href="classmdf_1_1_mdf_helper.html">MdfHelper</a> {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a188742f53fbe31e14425fc06da1b55a6">   23</a></span>  <span class="keyword">static</span> uint64_t <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a188742f53fbe31e14425fc06da1b55a6">NanoSecToLocal</a>(uint64_t ns_since_1970);</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a7f3c82d50f99650ae5068ffc8063ea61">   30</a></span>  <span class="keyword">static</span> int64_t <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a7f3c82d50f99650ae5068ffc8063ea61">TimeZoneOffset</a>();</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a7d3a60b5f4dde13b54f80a89895bf6b9">   38</a></span>  <span class="keyword">static</span> int64_t <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a7d3a60b5f4dde13b54f80a89895bf6b9">GmtOffsetNs</a>();</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a9dca21f3656e8b7dfc7795ad31a2138e">   47</a></span>  <span class="keyword">static</span> int64_t <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a9dca21f3656e8b7dfc7795ad31a2138e">DstOffsetNs</a>();</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a7af4f6bd644efeb45b8e8497520d1be7">   55</a></span>  <span class="keyword">static</span> std::string <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a7af4f6bd644efeb45b8e8497520d1be7">NsToLocalIsoTime</a>(uint64_t ns_since_1970);</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#af8d093bccbbd087a2e126bb47e9ceba0">   72</a></span>  <span class="keyword">static</span> std::vector&lt;uint8_t&gt; <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#af8d093bccbbd087a2e126bb47e9ceba0">NsToCanOpenDateArray</a>(uint64_t ns_since_1970);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span> </div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#aea95c071fce3ed0fc9c43e51b8cf8de8">   86</a></span>  <span class="keyword">static</span> std::vector&lt;uint8_t&gt; <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#aea95c071fce3ed0fc9c43e51b8cf8de8">NsToCanOpenTimeArray</a>(uint64_t ns_since_1970);</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span> </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a01ae5b5eeb114dbeda27d14f556a2872">  104</a></span>  <span class="keyword">static</span> uint64_t <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a01ae5b5eeb114dbeda27d14f556a2872">CanOpenDateArrayToNs</a>(<span class="keyword">const</span> std::vector&lt;uint8_t&gt; &amp;buffer);</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span> </div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#aa06f4a36bc0c226c5ebd55b12b016a48">  119</a></span>  <span class="keyword">static</span> uint64_t <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#aa06f4a36bc0c226c5ebd55b12b016a48">CanOpenTimeArrayToNs</a>(<span class="keyword">const</span> std::vector&lt;uint8_t&gt; &amp;buffer);</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span> </div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a7129f04876a4e66615b392720101c774">  131</a></span>  <span class="keyword">static</span> std::string <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a7129f04876a4e66615b392720101c774">NanoSecToDDMMYYYY</a>(uint64_t ns_since_1970);</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span> </div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a7eb6a410caa1e10c4f6f23d2ad46a838">  143</a></span>  <span class="keyword">static</span> std::string <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a7eb6a410caa1e10c4f6f23d2ad46a838">NanoSecToHHMMSS</a>(uint64_t ns_since_1970);</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>  </div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a8c4586c00bb1ab5968112836834f458d">  154</a></span>  <span class="keyword">static</span> std::string <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a8c4586c00bb1ab5968112836834f458d">NanoSecUtcToHHMMSS</a>(uint64_t timestamp_ns);</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span>  </div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a7f4300251cb46d8085cb5164e6631341">  165</a></span>  <span class="keyword">static</span> std::string <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a7f4300251cb46d8085cb5164e6631341">NanoSecUtcToDDMMYYYY</a>(uint64_t timestamp_ns);</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>  </div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#ad9193732941e7e79d75a88162670ed40">  180</a></span>  <span class="keyword">static</span> std::string <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#ad9193732941e7e79d75a88162670ed40">NanoSecTzToHHMMSS</a>(uint64_t timestamp_ns, int16_t tz_offset_min, int16_t dst_offset_min);</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>  </div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a1ca40750f159a599a34c8d8e126badd9">  195</a></span>  <span class="keyword">static</span> std::string <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a1ca40750f159a599a34c8d8e126badd9">NanoSecTzToDDMMYYYY</a>(uint64_t timestamp_ns, int16_t tz_offset_min, int16_t dst_offset_min);</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span> </div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a8c3d4c630de6852bf6539ac2d0c69469">  202</a></span>  <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a8c3d4c630de6852bf6539ac2d0c69469">Trim</a>(std::string &amp;text);</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span> </div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a75b60e6dddc18d313e2c9aa80de64bca">  213</a></span>  <span class="keyword">static</span> std::string <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a75b60e6dddc18d313e2c9aa80de64bca">FormatDouble</a>(</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span>      <span class="keywordtype">double</span> value, uint8_t decimals, <span class="keywordtype">bool</span> fixed = <span class="keyword">false</span>,</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span>      <span class="keyword">const</span> std::string &amp;unit = {});  </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span> </div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a0fa2c1d1a7fc70bee2f993f01c1aa175">  217</a></span>  <span class="keyword">static</span> uint64_t <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a0fa2c1d1a7fc70bee2f993f01c1aa175">NowNs</a>(); </div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span> </div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a25f5958900a95201a49c558a1aa2d8ea">  220</a></span>  <span class="keyword">static</span> std::string <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a25f5958900a95201a49c558a1aa2d8ea">Latin1ToUtf8</a>(<span class="keyword">const</span> std::string &amp;latin1);</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a6619fbbe8a58b58a53c64a804fa90d3d">  222</a></span>  <span class="keyword">static</span> std::string <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a6619fbbe8a58b58a53c64a804fa90d3d">Utf16ToUtf8</a>(<span class="keyword">const</span> std::wstring &amp;utf16);</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#abb37a8dee20837d7e1d973d26f49a9a1">  224</a></span>  <span class="keyword">static</span> std::wstring <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#abb37a8dee20837d7e1d973d26f49a9a1">Utf8ToUtf16</a>(<span class="keyword">const</span> std::string &amp;utf8);</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#a1d4549d6751b432656d0cd0f37479b04">  226</a></span>  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#a1d4549d6751b432656d0cd0f37479b04">ComputerUseLittleEndian</a>();</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno">  227</span> </div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"><a class="line" href="classmdf_1_1_mdf_helper.html#ad4336161b78bf69831fb113660c3cad1">  229</a></span>  <span class="keyword">static</span> std::vector&lt;uint8_t&gt; <a class="code hl_function" href="classmdf_1_1_mdf_helper.html#ad4336161b78bf69831fb113660c3cad1">TextToByteArray</a>(<span class="keyword">const</span> std::string&amp; text);</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>};</div>
</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span> </div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span>}  <span class="comment">// namespace mdf</span></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html">mdf::MdfHelper</a></div><div class="ttdoc">Support class for the MDF library.</div><div class="ttdef"><b>Definition</b> mdfhelper.h:15</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a01ae5b5eeb114dbeda27d14f556a2872"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a01ae5b5eeb114dbeda27d14f556a2872">mdf::MdfHelper::CanOpenDateArrayToNs</a></div><div class="ttdeci">static uint64_t CanOpenDateArrayToNs(const std::vector&lt; uint8_t &gt; &amp;buffer)</div><div class="ttdoc">Converts from a CANopen 7 byte Date array to nanoseconds since 1970.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a0fa2c1d1a7fc70bee2f993f01c1aa175"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a0fa2c1d1a7fc70bee2f993f01c1aa175">mdf::MdfHelper::NowNs</a></div><div class="ttdeci">static uint64_t NowNs()</div><div class="ttdoc">Return nano-seconds since 1970.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a188742f53fbe31e14425fc06da1b55a6"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a188742f53fbe31e14425fc06da1b55a6">mdf::MdfHelper::NanoSecToLocal</a></div><div class="ttdeci">static uint64_t NanoSecToLocal(uint64_t ns_since_1970)</div><div class="ttdoc">Adds the time zone offset to the time stamp.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a1ca40750f159a599a34c8d8e126badd9"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a1ca40750f159a599a34c8d8e126badd9">mdf::MdfHelper::NanoSecTzToDDMMYYYY</a></div><div class="ttdeci">static std::string NanoSecTzToDDMMYYYY(uint64_t timestamp_ns, int16_t tz_offset_min, int16_t dst_offset_min)</div><div class="ttdoc">Converts ns since 1970 UTC to a date string in 'DD/MM/YYYY' format in a specified timezone.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a1d4549d6751b432656d0cd0f37479b04"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a1d4549d6751b432656d0cd0f37479b04">mdf::MdfHelper::ComputerUseLittleEndian</a></div><div class="ttdeci">static bool ComputerUseLittleEndian()</div><div class="ttdoc">Returns tru if this computer uses Little Endian.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a25f5958900a95201a49c558a1aa2d8ea"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a25f5958900a95201a49c558a1aa2d8ea">mdf::MdfHelper::Latin1ToUtf8</a></div><div class="ttdeci">static std::string Latin1ToUtf8(const std::string &amp;latin1)</div><div class="ttdoc">Converts a Latin1 string to UTF8 string.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a6619fbbe8a58b58a53c64a804fa90d3d"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a6619fbbe8a58b58a53c64a804fa90d3d">mdf::MdfHelper::Utf16ToUtf8</a></div><div class="ttdeci">static std::string Utf16ToUtf8(const std::wstring &amp;utf16)</div><div class="ttdoc">Converts a wide UTF16 string to an UTF8 string.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a7129f04876a4e66615b392720101c774"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a7129f04876a4e66615b392720101c774">mdf::MdfHelper::NanoSecToDDMMYYYY</a></div><div class="ttdeci">static std::string NanoSecToDDMMYYYY(uint64_t ns_since_1970)</div><div class="ttdoc">Converts ns since 1970 UTC to local date DD:MM:YYYY string.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a75b60e6dddc18d313e2c9aa80de64bca"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a75b60e6dddc18d313e2c9aa80de64bca">mdf::MdfHelper::FormatDouble</a></div><div class="ttdeci">static std::string FormatDouble(double value, uint8_t decimals, bool fixed=false, const std::string &amp;unit={})</div><div class="ttdoc">Converts a float to a string.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a7af4f6bd644efeb45b8e8497520d1be7"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a7af4f6bd644efeb45b8e8497520d1be7">mdf::MdfHelper::NsToLocalIsoTime</a></div><div class="ttdeci">static std::string NsToLocalIsoTime(uint64_t ns_since_1970)</div><div class="ttdoc">Converts a nanosecond since 1970 to a local ISO date and time string.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a7d3a60b5f4dde13b54f80a89895bf6b9"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a7d3a60b5f4dde13b54f80a89895bf6b9">mdf::MdfHelper::GmtOffsetNs</a></div><div class="ttdeci">static int64_t GmtOffsetNs()</div><div class="ttdoc">Returns the GMT offset in nanoseconds.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a7eb6a410caa1e10c4f6f23d2ad46a838"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a7eb6a410caa1e10c4f6f23d2ad46a838">mdf::MdfHelper::NanoSecToHHMMSS</a></div><div class="ttdeci">static std::string NanoSecToHHMMSS(uint64_t ns_since_1970)</div><div class="ttdoc">Converts ns since 1970 UTC to local time HH:MM:SS string.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a7f3c82d50f99650ae5068ffc8063ea61"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a7f3c82d50f99650ae5068ffc8063ea61">mdf::MdfHelper::TimeZoneOffset</a></div><div class="ttdeci">static int64_t TimeZoneOffset()</div><div class="ttdoc">return the time zone offset in seconds.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a7f4300251cb46d8085cb5164e6631341"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a7f4300251cb46d8085cb5164e6631341">mdf::MdfHelper::NanoSecUtcToDDMMYYYY</a></div><div class="ttdeci">static std::string NanoSecUtcToDDMMYYYY(uint64_t timestamp_ns)</div><div class="ttdoc">Converts ns since 1970 UTC to UTC date in 'DD/MM/YYYY' format.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a8c3d4c630de6852bf6539ac2d0c69469"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a8c3d4c630de6852bf6539ac2d0c69469">mdf::MdfHelper::Trim</a></div><div class="ttdeci">static void Trim(std::string &amp;text)</div><div class="ttdoc">Remove white space from string.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a8c4586c00bb1ab5968112836834f458d"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a8c4586c00bb1ab5968112836834f458d">mdf::MdfHelper::NanoSecUtcToHHMMSS</a></div><div class="ttdeci">static std::string NanoSecUtcToHHMMSS(uint64_t timestamp_ns)</div><div class="ttdoc">Converts ns since 1970 UTC to UTC time in 'HH:MM:SS' format.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_a9dca21f3656e8b7dfc7795ad31a2138e"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#a9dca21f3656e8b7dfc7795ad31a2138e">mdf::MdfHelper::DstOffsetNs</a></div><div class="ttdeci">static int64_t DstOffsetNs()</div><div class="ttdoc">Returns the daylight saving time (DST) offset in nanoseconds.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_aa06f4a36bc0c226c5ebd55b12b016a48"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#aa06f4a36bc0c226c5ebd55b12b016a48">mdf::MdfHelper::CanOpenTimeArrayToNs</a></div><div class="ttdeci">static uint64_t CanOpenTimeArrayToNs(const std::vector&lt; uint8_t &gt; &amp;buffer)</div><div class="ttdoc">Converts from a CANopen 6 byte Time array to nanoseconds since 1970.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_abb37a8dee20837d7e1d973d26f49a9a1"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#abb37a8dee20837d7e1d973d26f49a9a1">mdf::MdfHelper::Utf8ToUtf16</a></div><div class="ttdeci">static std::wstring Utf8ToUtf16(const std::string &amp;utf8)</div><div class="ttdoc">Converts a wide UTF8 string to an UTF16 string.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_ad4336161b78bf69831fb113660c3cad1"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#ad4336161b78bf69831fb113660c3cad1">mdf::MdfHelper::TextToByteArray</a></div><div class="ttdeci">static std::vector&lt; uint8_t &gt; TextToByteArray(const std::string &amp;text)</div><div class="ttdoc">Converts a text string to a byte array.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_ad9193732941e7e79d75a88162670ed40"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#ad9193732941e7e79d75a88162670ed40">mdf::MdfHelper::NanoSecTzToHHMMSS</a></div><div class="ttdeci">static std::string NanoSecTzToHHMMSS(uint64_t timestamp_ns, int16_t tz_offset_min, int16_t dst_offset_min)</div><div class="ttdoc">Converts ns since 1970 UTC to a time string in 'HH:MM:SS' format in a specified timezone.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_aea95c071fce3ed0fc9c43e51b8cf8de8"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#aea95c071fce3ed0fc9c43e51b8cf8de8">mdf::MdfHelper::NsToCanOpenTimeArray</a></div><div class="ttdeci">static std::vector&lt; uint8_t &gt; NsToCanOpenTimeArray(uint64_t ns_since_1970)</div><div class="ttdoc">Converts from nanoseconds to CANopen 6 byte Time array.</div></div>
<div class="ttc" id="aclassmdf_1_1_mdf_helper_html_af8d093bccbbd087a2e126bb47e9ceba0"><div class="ttname"><a href="classmdf_1_1_mdf_helper.html#af8d093bccbbd087a2e126bb47e9ceba0">mdf::MdfHelper::NsToCanOpenDateArray</a></div><div class="ttdeci">static std::vector&lt; uint8_t &gt; NsToCanOpenDateArray(uint64_t ns_since_1970)</div><div class="ttdoc">Converts from nanoseconds to CANopen 7 byte Date array.</div></div>
<div class="ttc" id="anamespacemdf_html"><div class="ttname"><a href="namespacemdf.html">mdf</a></div><div class="ttdoc">Main namespace for the MDF library.</div><div class="ttdef"><b>Definition</b> canmessage.h:17</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
